<?php

$querUri          = time() % 2 == 0 ? 'http://lod2.eu/Query/Testimonials' : 'http://lod2.eu/Query/Demos';
$queryInstance    = new OntoWiki_Resource($querUri, OntoWiki::getInstance()->selectedModel);
$queryDescription = $queryInstance->getDescription();
$queryDescription = $queryDescription[$querUri];

$content = '';
if (isset($queryDescription['http://ns.ontowiki.net/SysOnt/sparql_code'][0]['value'])) {
    $sparqlCode = $queryDescription['http://ns.ontowiki.net/SysOnt/sparql_code'][0]['value'];
    $content    = $this->querylist($sparqlCode, 'lod2/item.phtml', array('options' => array('show_link' => true)));
}

$title = $queryInstance->getTitle();
if (empty($title)) {
    $title = 'Query Result';
}

?>
<div class="section random-results">
    <script type="text/javascript">
    $(document).ready(function () {
        if ($.browser.webkit && document.readyState != 'complete') {
            setTimeout(arguments.callee, 10);
            return;
        }
        
        var results = $('.random-results').find('.result').cycle();
    });
    </script>
    <h3><?php echo $title ?></h3>
    <div class="section-content">
        <?php echo $content; ?>
    </div>
</div>

